Find and delete all files with specific extension linux

To list all the files with an extention .log

find . -name "*.log" -type f -print0 | xargs -0 /bin/ls

To remove all the files with an extention .log

find . -name "*.log" -type f -print0 | xargs -0 /bin/rm

Ravindra Shinde
Ravindra Shinde
Research Scientist

I am a theoretical and computational condensed matter physicist and quantum chemist. I am currently working as a researcher at the University of Twente, the Netherlands. I am also the founder of The Science Dev.



Next